export default {
    props: {
      chartData: {
        required: false
      }
    },
    data() {
      return {
        chart: null
      }
    },
    watch: {
      chartData: {
        handler(val) {
          val && this.setOptions(val)
        },
        deep: true
      }
    },
    mounted() {
      let _self = this
      this.$nextTick(() => {
        _self.initChat()
      })
    },
    beforeDestroy() {
      if (!this.chart) {
        return
      }
      this.chart.dispose()
      this.chart = null
    }
  }
  